<%@page import="com.kaishengit.entity.Prod"%>
<%@page import="com.kaishengit.dao.ProdDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="top.jsp"  %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
    <title>My JSP 'main.jsp' starting page</title>
  </head>
  <body>
	<hr/>  
	<%
		String code = request.getParameter("code");
		if(code != null && "10006".equals(code)) {
	%>	
		<div style="color:red;padding-top:20px;font-size:14px">您当前还没有订单</div>	
		<%}%>
	<div class="container" style="padding-top:30px">
		<div style="float:right">
          		<a class="btn btn-danger" href="prod.jspx?m=add">←添加商品</a>
        </div>
		<div>
			<table class="table table-striped">
		<thead>
			<tr>
				<th>商品名称</th>
				<th>商品价格</th>
				<th>操作</th>
			</tr>	
		</thead>
		<%
			List<Prod> list = (List<Prod>)request.getAttribute("prodlist");
			for(Prod prod : list) {
		 %>
			
		<tbody>
			<tr>
				<td><%=prod.getProdname() %></td>
				<td><%=prod.getPrice() %></td>
				<td>
					<a href="prod.jspx?m=del&id=<%=prod.getId()%>">删除</a>
					<a href="prod.jspx?m=update&id=<%=prod.getId() %>">修改</a>
					<a href="prod.jspx?m=shopcar&id=<%=prod.getId() %>">加入购物车</a>
				</td>
			</tr>
		</tbody>
		<%} %>
	</table>
		</div>
	</div>
	
  </body>
</html>
